package com.shp.pojo;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import java.util.ArrayList;
import java.util.List;

/**
 * 商品拓展 联合查询
 * @author ZWL
 * @Version: 1.0
 * @create: 2020/2/25 0:18
 *
 * 注意：
 * 在mybatis集成springmvc时,假如mybatis采用了懒加载,而springmvc中利用@ResponseBody注解返回实体类的JSON时会抛异常:
 * 异常：com.fasterxml.jackson.databind.exc.InvalidDefinitionException:
 *          No serializer found for class org.apache.ibatis.executor.loader.javassist.JavassistProxyFactory$EnhancedResultObjectProxyImpl and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS)
 *         (through reference chain: java.util.ArrayList[0]->com.shp.pojo.GoodsExtend_$$_jvst914_0["handler"])
 * 解决： @JsonIgnoreProperties(value = "handler") 注解,让Jackson序列化时忽略handler属性:
 */

@JsonIgnoreProperties(value = "handler")
public class GoodsExtend {
    /**
     * 商品信息
     */
    private Good goods;
    /**
     * 商品图片集合
     */
    private List<Image> imageList = new ArrayList<Image>();
    /**
     * 商品评论集合
     */
    private List<Comments> commentsList = new ArrayList<Comments>();

    @Override
    public String toString() {
        return "GoodsExtend{" +
                "goods=" + goods +
                ", imageList=" + imageList +
                ", commentsList=" + commentsList +
                '}';
    }

    public Good getGoods() {
        return goods;
    }

    public void setGoods(Good goods) {
        this.goods = goods;
    }

    public List<Image> getImageList() {
        return imageList;
    }

    public void setImageList(List<Image> imageList) {
        this.imageList = imageList;
    }

    public List<Comments> getCommentsList() {
        return commentsList;
    }

    public void setCommentsList(List<Comments> commentsList) {
        this.commentsList = commentsList;
    }


}
